home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / SFGETFOL / READ_ME_.FIR < prev   
Text File  |  1992-06-06  |  3KB  |  60 lines

  1. Introduction
  2.  
  3.     The Think C code in this archive implements a custom Standard File Dialog 
  4.     that allows users to select folders in which to save or locate files.  
  5.     All code and resources you need to use StandardGetFolder are included.  Also 
  6.     included is a small sample program (in Think C) demonstrating the use of 
  7.     StandardGetFolder.
  8.  
  9.  
  10. Requirements
  11.  
  12.     Due to the fact the StandardGetFolder makes use of the CustomGetFile toolbox
  13.     function and FSSpec records, it will only work under Sytem 7.0 or later. 
  14.  
  15.  
  16. Using StandardGetFolder
  17.  
  18.     First, you need include the ANSI and MacTraps libraries in your project. You 
  19.     also need to include the resources (one DLOG and one DITL) from the file 
  20.     'GetFolder.╣' in your project resource file.
  21.  
  22.     StandardGetFolder works pretty much like StandardGetFile. Here's the 
  23.     function prototype:
  24.  
  25.         void StandardGetFolder (    Point               where,
  26.                                     Str255              message,
  27.                                     StandardFileReply   *mySFReply);
  28.                             
  29.     You pass it the point where you want the dialog displayed, the prompt you 
  30.     want it to display above the file/folder list, and a pointer to an Standard 
  31.     File Reply record.  Upon return, the sfFile field of the SFReply record (an
  32.     FSSpec record) will contain the volume reference number and directory ID 
  33.     that reference the directory the user chose.  You simply need to add a file 
  34.     name to the FSSpec record.  See the sample program 'sample.c' to see how
  35.     this works.
  36.  
  37.  
  38. Acknowledgements
  39.  
  40.     Portions of this code were originally provided by Paul Forrester          
  41.     (paulf@apple.com) to the think-c internet mailing list in response to my   
  42.     my question on how to do exactly what this code does.  I've added a       
  43.     couple of features, such as the ability to handle aliased folders and     
  44.     the programmer definable prompt.  I also cleaned and tightened up the code,   
  45.     stomped a couple of bugs, and packaged it up neatly.  Bunches of work,    
  46.     but I learned A LOT about Standard File, the File Manager, the Dialog      
  47.     Manager, and the Alias Manager.  I tried to include in the comments some   
  48.     of the neat stuff I discovered in my hours of pouring over Inside Mac.     
  49.     Hope you find it educational as well as useful.                            
  50.  
  51.  
  52. Bug Reports, Kudos, etc.
  53.  
  54.     If you find a bug, have a better way to do something than the way I did it,
  55.     or just appreciate the code, feel free to drop me a note at 
  56.     kkirksey1@aol.com.
  57.     
  58.     
  59.                                    Ken
  60.